<?php
class UnInstallPlugin extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		$me = check_login ( ADMIN_LOGIN_PAGE );
		$pid = rqst ( 'pid' );
		if (empty ( $pid )) {
			$data ['success'] = false;
			$data ['msg'] = "未知插件ID";
		} else {
			$plgMgr = PluginManager::getInstance ();
			$rst = $plgMgr->uninstallPlugin ( $pid );
			if ($rst) {
				$data ['success'] = true;
			} else {
				$data ['success'] = false;
				$data ['msg'] = '卸载插件失败，详情请见error.log。';
			}
		}
		return new JsonView ( $data );
	}
}